const _ = require('lodash')

const match = _.curry(function (reg, str) {
  return str.match(reg)
})

const havespace = match(/\s+/g)

const haveNumber = match(/\d+/g)

const filter = _.curry((fn, arr) => arr.filter(fn))

const findSpace = filter(havespace)

// console.log(havespace('dfdf dfdf dfd'))

// console.log(haveNumber('dfdfh2fg23d'))

console.log(filter(havespace, ['joe joe', 'joe_joe']))

console.log(findSpace(['joe joe', 'joe_joe']))
